page allocator: add mfn_valid() check to free_heap_pages() and scrub_pages()
The changesets, 19913:
ef38784f9f85 and 19914:
d6c1d7992f43 eliminates
boot allocator bitmap which is also used for buddy allocator bitmap.
With those patches, xen/ia64 doesn't boot because page allocator
touches struct page_info which doesn't exist.
That happends because memory is populated sparsely on ia64
and struct page_info is so.
This patches fixes ia64 boot failure.
In fact, this is also a potential bug on x86. max_page seems
to be well aligned so that MAX_ORDER loop check prevented
to be bug appear.
- fix free_heap_pages().
When merging chunks, buddy page_info() doesn't always exists.
So check it by mfn_valid().
- fix scrub_pages()
On ia64 page_info() is sparsely populated, so struct page_info
doesn't always exist. Check it by mfn_valid()
- offline_pages(), online_pages() and query_page_offline()
Also replace "< max_page" check with mfn_valid() for consistency.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>